from drf_spectacular.utils import extend_schema_view, extend_schema
from rest_framework import viewsets,mixins
from home.models import Carousel
from home.serializers import CarouselSerializer
# 轮播图接口
@extend_schema_view(
    list=extend_schema(summary='获取轮播图列表',tags=['轮播图'],description='获取轮播图列表'),
    # create=extend_schema(summary='新增轮播图', tags=['轮播图'], description='新增轮播图'),
    # update=extend_schema(summary='更新轮播图(全量更新)',tags=['轮播图'],description='更新轮播图(全量更新)'),
    # partial_update=extend_schema(summary='更新轮播图(部分更新)',tags=['轮播图'],description='更新轮播图(部分更新)'),
    # destroy=extend_schema(summary='删除轮播图',tags=['轮播图'],description='删除轮播图')
)
class CarouselViewSet(mixins.ListModelMixin,viewsets.GenericViewSet):
    queryset = Carousel.objects.all()
    serializer_class = CarouselSerializer
    pagination_class = None